refactors endorsements controller