Removed small code duplication.