NEXUS-6176: Simplified code

Applied Stuart's comments.