Add ILoggern & code refactoring