Refactored Player goroutine into clear state machine