Static function for getting the state