Move language TS code to main.ts