cleanup code for datasource initialization