refactor basic coffeescript