Refactored some more code
Refactored more code