Removed hardcoded values for header size and defined constants.