fix a bug.
refactor all.

- insert a layer to deal with many view.
- use abstract data-structure.
- etc.