continous refactoring

Added more refactored code.