Move cartridge handling to its own module