better method of parsing mime headers