Adding headers and refactoring a little bit.