Framework and more refactoring for speed layer test