Renamed toIndex to snake case

Signed-off-by: Frédéric Vachon <fredvac@gmail.com>