Moved some stuff around between files