Refactoring internal methods.