refactorings, added config to distribution