better encapsulation of code