Refactored the solution into distinct item classes