simplify the codes