cleaner way of removing trailing zeros