Refactored data and helper function.