Implementing the factory method pattern to Pieces creation