bits and pieces before rewrite #2