Refactor basket