Make [f_ap] more powerful

It now can use [apD10] and deal with some dependent functions.