Removed some of the duplication.