moved index code to the public folder