converted to clean coffeescript