Added Ini file support, refactoring