Refactoring with CoffeeScript
Some refactoring