Massive refactoring
Refactored getallheaders()