Cleaned up inventory utils.