Piece preview; refactor text writing