Final clean up, remove some presenttion logic, add some comments