ENYO-2405: Some refactoring and code cleanning.