add home state;
separate concerns into various files
refactor to use factory
rename mainController to homeController