Refactor delegates and fix them