change struct functions to new calling style