major refactoring: seperated all templates in html and js file for much better code reading