more functorization to allow flexbible test case setup