refactoring of functional test to use a test db