Refactored generate players file