Made javascript cleaner