second part refactoring for room