refactored and added new files