bug850572: some refactorings