Refactor: Refactore _flush_cache method of the User model.