transform data from database in objects