Removing code duplication.