refactor put_handler.go