Continue refactoring lobby to use db functions