improve code and rule