Replace pattern match on Option with map