Split template code into a Root application class.