[Refactor] Rewrote game detection

Cut out the severely repetitive code.