factored out Player class