MULE-6918: Adjust code after pull request suggestions. Make it work in cluster and add more tests is still pending.