Refactor with comments