Refactored logic out into collection