refactored issue with trim , lower and upper functions