better encapsulation of logic