Added where injection test and did some cleaning up