Added model classes and selection logic
Improved selection logic