some cleanup work and keyval initial dao