extracted encoding to own function