move some code to content_wrapper