refactoring + some new things, may be not work..