Refactored crossval method