Refactoring transition with CoffeeScript