move parsing of body for ip to separate fn