Finishes code refactoring for exercise 3
requested review from @mariueng
assigned to @mariueng
merged
mentioned in commit 15439eb3