index refactored, copypaste descrease