Refactoring exercise for TWU