code refactoring

-allow a verbose mode for more/less output
-better logging