improve efficiency of object and vector get and set