Improve code structure, simple PDF export