refactorings to reduce code duplicate
Merge branch 'refactoring/DRY'