More efficient implementation.