Refactoring some methods.