refactor: prettier way of finding indices