extract a proc running method. improve logging