better string building

TODO handle exceptions better