JavaScript Code for easier developing