split up daemon.go into logical files