Restructuring and logger class