Refactor to support any block type