Litedown: moved a bit of code. No functional change intended