Removed unused boilerplate code.
Added more logging.