Change from java Properties to apache commons-configuration PropertiesConfiguration object. This has some nice features, one of which being maintaining the structure, comments etc of properties files when loading/changing/saving.