Refactored Video Header Code a Bit