Refine generating references after rebuilding solutions