addressing PR comments
refactoring