Organized js code