Improved abstraction of encapsulated code which resolves at runtime