Switched to CoffeeScript for readability and safety