Delete trailing whitespace.
Move often used globals to separate file.
Fix renamed function call.
Fix superfluous user argument.