Centralise more database fetch code