Moved multilayer logic part to pynag.Model