Cleaning up some db calls not properly ported to new framework