major code refactor in http plugins