Actual code to do it
drastically simplified config format