Split JS utils into separate reusable file