Clean up home() function.

De-nest ifs as much as possible.