Merge "Refactor checking for inserting activity into existing task."