Clean up namespace declaration parsing code