Optimize code for computer inventory