Moved from JavaScript to TypeScript