fix-simplify the code