slight modification for performance