some organising and cleaning up