Last fixes
Refactored code into an more or less abstract engine system