Polishing and tidying code