Corrected removing block steps

Note: switched to passing a function reference to avoid needing to keep
the CodeMenuLayout index up to date.