Reorganizing code so godoc works