Remove duplication in foreground resizing.