made the controllers cleaner and flexible for search
final commit of merge