cleaner code, let's use js construction, not reimplementing java ones