refactoring and TODO-notes