cleanup body regex parsing and make it more flexible