converting some more stuff to coffee-script