move scope updates to callbacks