Refactored Pipe view and controller, added more code comments