small refactorings and bunch of TODO markers added