Code cleanup and getting ready for AJAX list update