Refactored all models and created tests