avoid excessive DB queries
Merge remote-tracking branch 'upstream/master'