Refactor to remove warnings.