And refactor some code a bit, don't use bytes.Clone where type-specific helpers may be used instead. Close #2907. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>