Avoid pattern matching on Option -- especially when you are doing nothing with the None case;

jobIDToStageIDs.get(jobID).map(_.foreach(stageid => stageIDToJobID -= stageid))