Now using coffeescript on server side to clarify the code