refactoring raf