Refactor js to coffee files