extract some methods
make some member private in view