refactoring - better support for different emulators