Some refactoring, started persistence component