refactored create and delete app scripts