Refactoring writer and generic repository

- Refactoring writer and generic repository
- Unskipped tests in ResourceTypeRepositoryTest & ToolRepositoryTest