Refacto and Fixed end game system