refactor access to compilation database from source index