WHAT IS CODE REFRACTORY?
CODE SEGMENTATION- means
do not write multiple logic in a single method.
the code should not be more than 20 lines.- Very high practice.
So segment your code in to 2 or more small methods.
check or try -- Best refactoring technique from Addison wisely publication