finishing sqlite config generation and code refactor