header parsing complete + many smaller enhancements