simplify deps and add update-fn as paramater
do not force int