Move js codes into separate files.