Cleaning up main.js and fixing contacts.find call