cleaning up some database stuff