Minor efficiency changes