refactoring is continued, bug-fix