ENYO-2497: Code rewriting