added common sub
excised the state module