Refactoring: use join() instead of concatenating