refactor with jquery and modules and such