cleanup code, fixed some logging config