moving getting object instance index to a function