Refactored away services.

Putting back the functionality now before ui tests.