Second part of refactoring.