refactoring
3rd iteration