Refactored the code to include a separate data source. Needs refining.