refactor and support wkhtm;