cleaning up (way overthought all the structs, but it was fun...)