* update milestone issues numbers when save milestone and other code improvements * fix tests * extract duplicate codes as a new function