refactoring according to repo owner's comments