CAMEL-7673 polish the code