Javadoc; refactor inventory processing.