make preview as a module method