Move inventory utils into own file