Minor refactoring
Added CoffeeScript implementation