dry the code for state