cleaned up header/param parsing