My first approach was to test that serializerId is actually in the map, and depending on the result returning an appropriate Failed(...) or Try(...). This was rejected for performance reasons (double lookup). I don't like allocating an Option, neither creating an unnecessary Try with transform(). Do you have another idea?