convert some more prints to logging methods
fix coding style