Removed unused code, Added proper logging, fixed imports