Refactored CommonActivity to extract inner class MainTextFormatter