Re-factoring to clean up data service processing logic