Refactored into helper method