added the possibility to use a proc or labda as an index_name