Refactor handling of 'continue' packets into fucntion