started factoring out view stuff off main.js