Added logger and decoupled the test code