refactored alignment of text output