Restructure badges.rb