logging added
code cleanup