Function encapsulation