Modularize and add VERBOSE mode