Refactored code (not finished)
Refactored code (not finished)