code cleanup, proper logs