WP-4712 Some changes related to db calls