Coffeescript refiew and improvements