add getConfigAt

and simplify environment and role checks