moved global variables into horse template