Refactored #1 in HW