refactoring js functions on a new file
Merge pull request #28 from baambooli/TA-25

refactoring js functions on a new file