fixes and tidying