refactor of basket and handler, introduced a factory method to create the basket