Cut out one db call from functions in previous two commits.