canvas encapsulation