some refactoring
added headers