method encapsulation of code