added some query methods
renamed some structs and methods