headers managment + general fixes