Add encapsulation code