finish refactoring ban code