refactoring for full-width mode