cleanup, indexOf bugfix