refactoring some data structs