Clean up code.
Rewrite grid layout.
Clean up grid layout.