Move user lookup in the exec plugin into it's own function, as suggested by @octo.