Refactored code and update models and migrations to include services