better index for span and component