behavior refactoring bugfixes.