add app_date to patent struct, clean up code a bit