#820 Refactor de Repositories to use Optional

This pull request concerns the full integration of Optional type in  repository's components