updated javascript file structure