Refactoring FlushException