refactors test to remove db dependencies