refactoring
fix space management when parsing blocks
add extractBlocks method
parse blocks
add blocks parsing