Refactored to use java.lang.reflect.Proxy