Done all main work

* need small fixes
* need refactoring