Restructured the functionality so that all the operations can be done
within one page.