Refactoring after receiving comments from the lecturer