splitting index into index and header