refactored model classes, changed UI and modified thread