Extract Method

in condition it should move into method to improve readability