Refactor various methods.