Code refactored due to engine changes (lionengine#19)