refactored results controller