Refactored repositories controller.

Signed off by: Daniel Bucher <daniel.bucher88@gmail.com>
Merge pull request #34 from mezuro/refactor_repositories_controller

Refactored repositories controller.