Refactored the helpers.