Refactored the collect controller