Remove excessive whitespace

Remove excessive whitespace and format main classes.