Refactors for test setup