Use cb_context:setters(Context, ListOfSetters) instead of your lists:foldl(fun fold_over_setters/2)