Moved templates to js file