refactoring couple of repetitions