Restructured the way datasources are handled