Improve auto-complete code