Tried to make it a bit cleaner.
Until there is a more elegant solution to avoid unwanted white space trimming, this will let users disable that feature if it is not something they need.