refactor in progress in order to be compatible with more NoSQL/JSON datasources like MongoDB