Better checking to avoid object creation