refactor js
refactored CoffeeScript
resolved conflicts