optimize allowList checking and inline a local assignment