moved struct stuff into structs