why even have this object wrapper around the array? replace([patterns]) would look better