Abstracted DB calls into functions for later translation.