Modularized the rest of the emulator