refactor model and added tests for services
Merge remote-tracking branch 'origin/master'