refactor items_ctrl.js to comply style guide