Added if-less and more readable string generation by suggestion of rab (github.com/rab)