Created a piece factory.