Refactored game detail page js