New Optimization of idp_metadata.rb