abstract the process loop to be reusable for other binaries