CSVDB refactor