add logger
Code cleanup.