DRY, fix #11, handlePatch