convert to libraries and new config format