refactor sql stuff / data quality getters