Answer ex3.25
Refactor ex3.25
Refactor ex3.25 (extract some statements to a function)