major cleanup, make sure jshint is happy