got rid of unecessary code in datasource method