refactor of Db and Kv using static config only