Modularizing the js