some more tasks, code refactoring