Last but not least port to TypeScript