moved index to templates