#9 refactoring - remove dry code