Refactor of how forms and previews are built