Could you use the exists() methods instead of your implementation?