optimize apex completions