refactor get variables on listing index to work with global template variables