add html template and preprocessing