making it more java-script "modular"