small refactorings and package changes