Layout only if necessary