Add the mountain
hideout (based on where actual ninja
clans may have retreated after the Iga Revolt) and their employment by various shogun of the era (ninja groups would certainly switch loyalties rather easily), and you've got a setup which is actually a fair bit closer to real life than you'd expect.