engine init method refactored