refactored creation of blocks via a new BlockFactory