reorging javascript file structure a bit