refactoring configuration persistance