refactoring some
adding missing refactored files
refactored some more and verified all tests are passing