DRY up namespace creation

Yeah, sounds like a good simplification of the original yui function.