changing IOModel to build database and select data out