Refactor plugin controllers