reduce the code