clean up the helpers for pdf view
split up helper methods so it's not a behemoth