refactored all files into one js file