some reafactoring, before package refactoring