refactor centering and apply also for contents