Refactoring the name of variables and class to put in java patterns