Don't create anonymous function when we can simply use the named function
Directly use the return value of .is('checked') to set variables
Merge pull request #4 from rmehner/small_refactorings

Small refactorings