refactoring at set_ban()