Use StringBuilder for faster string creation and some other clean up