DAR-712, refactoring based on feedbeck from PR