Vanilla JS helpers