refactored site to use the repository pattern