Refactoring. Add Pan and Device. Add profiles.