better encapsulation of complete app state