More code pulled out of home.asm