Major refactoring
Small coffeescript change