finished refactoring old.js as CoffeeScript