Refactor of block code.