Refactor code of handling defeat Players