more refactorings / internal shuffles