Refined the logger class and made Main more efficient