move update functions to higher level