refacotring preview