Cleaned up generator, removed TypeScript support and added states