cleaned up javascript file structure.