[~] refactoring in encoder part