Make add_namespace function more readable.