Cleaning up code, moving stuff to engine.
Cleaning Code