parsed parts of message header and resource
moved resource to separate file
extracted method for adding subelements