Nf refactor