refactoring

code refactoring...