factor out utility for validating player key and usage of it