added preview and partial to action, abstracted rendering logic