Refactor record insertion

Make it non-duplicated, but very ugly nevertheless.
Use Unicode only if allowed by command