Refactoring getting one object from DB

Change-Id: If8d3b01c241dd64f1e5c095634697d2a120df201
Merge "Refactoring getting one object from DB"