Better handling ov overloading __index using a function