text alignment refactor