gsub! to sub!
Improve UI for autocommit.
decrease code nest.