Added some helper functions to State and removed some unused stuff