move diff to its own controller and cleaned up some code