make javascript neater