Refactor hw0