simplify codes.