tighter scoping
refactor block->sub, support dumpiong text