I don't like the way this is nested...

But I like duplicating code even less...