refactor pieces to include data about itself
further refactor