Refactored problem controller a little