refactor to be more coffeescript classy