refactored code
8 files changed