Refactor and add verbose option