Refactored to use controllers