Created javascriot file and started moving some functions to the file