generalize twopane layout