added ability to pass callbacks to the run function
split off vpn lookup into separate function to make the program flow
clearer