refactor controller and view
Merge pull request #3 from jbwhite/refactor

refactor controller and view