pulling functions out of state