refactored models and services