move engine startup code to its own class