moved templates to partials and some js formatiing