Refactoring. Added the possibility of multiple game modes