Refactor block parser.