code refactoring v1.2