Added State and Key classes with some funcs