add open save method
clean some code