making javascript modular