More generic solution - #2783