move model to lib/
more work on model layer