refactored by adding controllers