cleanup code a bit

Some formatting, some logic
because its nice to know what variables are being used in a method. JS does this internally anyway. Its also habit from jQuery days: http://contribute.jquery.org/style-guide/js/#assignments