resolved issue with finding the correct domain class when the instance object is a javassist proxy class which is actually a different class object; extracted common code into a new util class