Refactor some methods.