Refactoring of the logic to OOD.