Minor code cleanup and ready for forking