Small refactor in engine initialization