Merge "Changed some parts of the code to prepare it for script support that will come in later commit."