flatten dict to comply with ES 1.0 update issues