separated inspect and toTypeScript into separate methods