cleaned up code on header and index