Refactor code and improve Player