block.js cleanup code