refactored app, polished up templating