refactored and cleaned the code