Refactor ajax dream controller

excellent!