begin preview refactor