Added more protocol support and refactoring <Tanvi>