refactored get games index to helper.js