Currently the way layouts are handled _works_ but the code is really messy and hard to modify. That needs fixing.