Migrating to vanillajs