Condensed the code.