refactoring html, added exporting to pdf