Encoders refactoring