some polishing and small fixes