Some ...M functions refactored.