optimised escope usage as recommended in #8