More efficient way of doing this.