A little refactoring to give internal services the ability to access the
database