refactor pieces