refactored the items controller