Mocked controller_activity_logging; some refactoring.