Refactor Repository
Refactor Environment and add specs for its relation reader