refactor and prune pseudo - duplicate code
clarify the binary display
optimize the dynamic resize logic