OPTIMIZE THE CODES.