Implementing code review recommendation and improving logging a bit