store js functionality in external file