refactoring to coffee script