Separated engine code into more logical sections