blocksFactoryManager and some ugly code in tests.