finishing version 2.0
Some refactoring is need.