[nim] Optimising layout