Refactoring concurrent examples