Cleaned up comments and logging