Refactoring some code for the wordup simple codebase.