Refactor ex4.19