refact datasource module