models: switch to arrays. Speed may be low? (because of indexOf)

Signed-off-by: mkhropov <mkhropov@gmail.com>