Refactoring +  Fixed Bugs