Revised useBlock to use reflection rather than if statements.