improve $Elements ctr performace, fix code review issues