Refactored to support sliced headers.