Correctly refactored code left old code in comments for troubleshooting