cleaning up the js, getting more mvc, to be refactored more!!