refactoring the ariline exercises