#21 refactoring