refactor preview to xview component