added desc save and refactored some code