move model to scala