refactor pieces into factory