cleanup imports, __index__ and __contains__