Add trimming for spaces and new lines