Code cleanup; removed unused ff-related functions