Added scanner listener
cleaned up some code
fix bug, undefined variable 'settings'
Called register listener callback methods on init