Removed code duplication with Iglu Scala Client and got tests passing