Some decompositions of Bernoulli sets and codes