Code cleanup

-  reorganized code and created a config file
Resolved conflicts on merge
franz merge with dev