inventory code cleanup