Opertimize implementation