Refactored code into a helper method