optimize the code, no function added