Tidying up code and packages - R Beckett