simplify the code by removing the modify method.