Consolidating duplicate code.