restructured the app a bit in vanilla js