Small refactor in engine initialization
Merge pull request #421 from anserran/smallrefactor

Small refactor in engine initialization