improve solution to allow custom mapping of class names when wrapping them