ww - removing duplicate code