better encapsulation of functions