refined main fptree mining fn [ci skip]