Some refactoring for the remove player javascripts