Generalize, pushed logic to spiedFn