refactoring for new full-width mode