reformatting repository controller
major repository refactor

missing some tests