Performance improvement. See #51