Modularized handling of continuations