Tidying up some code, dependancies