minor coding style changes and removal of console.log