Changed conf schema and some refactoring