Tiny refactoring ideas from http://javascriptplayground.com/blog/2013/06/refactoring-js/.
Also removed .live() and added few JSDoc lines