APcode refine