massive refatoring of getObj to support forward recursion