Cleaning up the coffeescript and javascript