Tidying up, add some improvements