move appmodel into separate module, start using nested layouts