use meta programming for states methods