Encapsulate object-state state tests and setttings in macros.