Minor refactoring to make backgrounds and borders shared.