Refactor to use services.
Refactor code.