Moving file to pure JavaScript.