move some observer code out of models