Move the htmlSerializer out of the context