rewrote some of apexctl-reset