Modified functions to use new structs