trying to add refactored code