fix order of includes and use index files