Break out code into separate functions, triggered by onAfterRoute
Add table to store lat_run for future logging