rewrite local as a class for factory pattern in Player file