addressing pr comments - refactoring