added more seperation in code by adding events, render, and update js files;