restructured config and some cleanup