refactors number of players method to use inject