refactor to coffeescript part2