[UPDATE] made getting a data index a general module.