Refactores code for HeadersSequence class usage