cleaned up a bit with JSHint