Could we reuse this code here https://github.com/rightscale/right_support/blob/master/lib/right_support/data/serializer.rb