Refactor some methods and variables.