Epic refactoring for tests