#50 - Refactored complex functions