Moved some controller code to a service.
Little Code improvement.