updating coffeescript to improve testability