minor changes
Added config re-creation, code cleanups, added more and cleaner comments