Move more object setup code to main.js