Removing printf statement
Separating handlers in main.js into separate functions
Minor fixes