Refactor from the existing method.