Refactoring due to irrational dislike of global variables.