Cleaned up logfile method