Clean up document observer code. Give it a better name.