Refactoring encoding of constant into Code class to embrace SRP.