replace formatting with joins

and remove some dict lookups