realm refactoring finished