runtime.rb: separate model instantiation and get_state