completed code refactoring phase1