(Issue #3781) More general approach