Extract Method

Since we notice that code have 2 duplicate block
we can use Extract Method