removed commented out script
Cleaned code and moved templates into a separate partial