Cleaning code little bit with CoffeeScript functions