code reduce for simplicity