refactored and tested
remove unrequired files