refactoring the F