Change structure to use endpoint