Allow both string and function conditions