moved index scripts to an external file