Add documentation and rename some variables - refs BT#7998