fp refactoring