remove dbcontroller

and tidy up source