Seperated some javascript code into different files and arranged the code based on the template helpers and events