began coffescript refactoring