Changed the way entity headers are read, it's much cleaner now