Move DB blocking logic into service