Improve header layout and add internal variables