minor refactor on build index