Added some logging and cleaned up imports