refactor devices added models and there tests