extract dispatcher and add comments