make JSHint happy again
some code cleanups